﻿@using System
@using Exceptionless.Core.Extensions
@inherits RazorSharpEmail.EmailTemplate<Exceptionless.Core.Mail.Models.EventNotificationModel>
@{ Layout = "_Layout.html.cshtml"; }

<!-- BODY -->
<table class="body-wrap" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; width: 100%;">
    <tr style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
        <td style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;"></td>
        <td class="container" bgcolor="#F7F7F7" style="margin: 0 auto; padding: 0; font-family: 'Open Sans', arial, sans-serif; display: block; max-width: 600px; clear: both;">

            <div class="content" style="margin: 0 auto; padding: 15px; font-family: 'Open Sans', arial, sans-serif; max-width: 600px; display: block;">
                <table style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; width: 100%;">
                    <tr style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                        <td style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                            <p class="lead" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-bottom: 10px; font-weight: normal; font-size: 17px; line-height: 1.6;">
                                @if (Model.IsNew) {
                                    <text>
                                        A new @if (Model.IsCritical){<text>critical </text>}error has occurred in the "@Model.ProjectName" project.
                                    </text>
                                } else if (Model.IsRegression) {
                                    <text>
                                        @if (Model.IsCritical) {<text>A critical</text>} else {<text>An</text>} error has regressed in the "@Model.ProjectName" project.
                                    </text>
                                } else {
                                    <text>
                                        @if (Model.IsCritical) {<text>A critical</text>} else {<text>An</text>} error has reoccurred for the @Model.TotalOccurrences.ToOrdinal() time in the "@Model.ProjectName" project.
                                    </text>
                                }
                            </p>

                            <div class="fieldset" style="margin: 0; padding: 15px; font-family: 'Open Sans', arial, sans-serif; font-size: 13px; background-color: #ffffff; margin-bottom: 15px; border: 1px solid #D5D5D5; border-radius: 4px;">
                                @if (!String.IsNullOrEmpty(Model.TypeFullName)) {
                                <div class="field" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                                    <h5 style="margin: 0 0 8px 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; line-height: 1.1; margin-bottom: 15px; color: #000; font-weight: 900; font-size: 13px;">Type</h5>
                                    @Model.TypeFullName
                                </div>
                                }
                                @if (!String.IsNullOrEmpty(Model.Message)) {
                                    if (!String.IsNullOrEmpty(Model.TypeFullName)) {
                                    <div class="hr" style="margin: 8px 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; height: 0px; border-bottom: 1px solid #D5D5D5; font-size: 1px;"></div>
                                    }
                                    <div class="field" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                                    <h5 style="margin: 0 0 8px 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; line-height: 1.1; margin-bottom: 15px; color: #000; font-weight: 900; font-size: 13px;">Message</h5>
                                    @Model.Message
                                </div>
                                }
                                @if (!String.IsNullOrEmpty(Model.Url)) {
                                    if (!String.IsNullOrEmpty(Model.TypeFullName) || !String.IsNullOrEmpty(Model.Message)) {
                                    <div class="hr" style="margin: 8px 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; height: 0px; border-bottom: 1px solid #D5D5D5; font-size: 1px;"></div>
                                    }
                                    <div class="field" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                                        <h5 style="margin: 0 0 8px 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; line-height: 1.1; margin-bottom: 15px; color: #000; font-weight: 900; font-size: 13px;">Source</h5>
                                        @Model.Url
                                    </div>
                                }
                            </div>

                            <!-- Button -->
                            <p class="center" style="margin: 10px auto 0 auto; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-bottom: 10px; font-weight: normal; font-size: 14px; line-height: 1.6; text-align: center;">
                                <a class="btn" href="@Model.BaseUrl/event/@Model.Event.Id" rel="notrack" target="_blank" style="margin: 10px auto 24px;padding: 10px 15px;min-width:200px;font-family: 'Open Sans', arial, sans-serif;color: #FFF;text-decoration: none;background-color: #6b991c;font-weight: bold;margin-right: 10px;text-align: center;cursor: pointer;display: inline-block;border-radius: 3px;">View Error Details</a>
                            </p>

                            <div class="other" style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;">
                                <h5 style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; line-height: 1.1; margin-bottom: 5px; color: #939393; font-weight: 900; font-size: 17px;">Other Actions</h5>
                                <ul style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-bottom: 20px; font-weight: normal; font-size: 14px; line-height: 1.6;">
                                    <li style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-left: 5px; list-style-position: inside;"><a href="@Model.BaseUrl/stack/@Model.Event.StackId/mark-fixed" rel="notrack" target="_blank" style="margin: 0;padding: 0;font-family: 'Open Sans', arial, sans-serif;color: #578F01;">Mark error as fixed</a></li>
                                    <li style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-left: 5px; list-style-position: inside;"><a href="@Model.BaseUrl/stack/@Model.Event.StackId/stop-notifications" rel="notrack" target="_blank" style="margin: 0;padding: 0;font-family: 'Open Sans', arial, sans-serif;color: #578F01;">Stop sending notifications for this error</a></li>
                                    <li style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif; margin-left: 5px; list-style-position: inside;"><a href="@Model.BaseUrl/account/manage?projectId=@Model.Event.ProjectId&tab=notifications" rel="notrack" target="_blank" style="margin: 0;padding: 0;font-family: 'Open Sans', arial, sans-serif;color: #578F01;">Change your notification settings for this project</a></li>
                                </ul>
                            </div>

                        </td>
                    </tr>
                </table>
            </div>
            <!-- /content -->

        </td>
        <td style="margin: 0; padding: 0; font-family: 'Open Sans', arial, sans-serif;"></td>
    </tr>
</table>
<!-- /BODY -->
